package com.atguigu.customer.demo.service.impl;

import com.atguigu.customer.demo.bean.Customer;
import com.atguigu.customer.demo.mapper.CustomerMapper;
import com.atguigu.customer.demo.service.CustomerService;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@DS("mysql1018")
public class CustomerServiceImpl extends ServiceImpl<CustomerMapper,Customer> implements CustomerService {

    @Autowired
    CustomerMapper customerMapper;

    @Override
    public Customer getCustomerById(String id) {

        Customer customer = customerMapper.selectById(id);
        //return customerMapper.selectCustomerById(id);
        return customer;
    }

    @Override
    public void saveCustomer(Customer customer) {
            baseMapper.insert(customer);
    }
}
